package com.zhuss.product.line;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.product.line.DetailLineBo;
import com.zhuss.bean.bo.product.line.SearchLineBo;
import com.zhuss.common.ReadService;
import com.zhuss.product.processor.LineRead;
import com.zhuss.enums.新线招募类型;
import com.zhuss.exception.DzcxException;

/**
 * @description: 线路查询Service
 * @author: zhushanshuo
 * @create: Wed Dec 30 13:08:49 CST 2020
 **/
@Component("lineReadService")
public class LineReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("lineRead")
	private LineRead lineRead;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailLineBo bo = (DetailLineBo) param;
		Long lineId = bo.getLineId();
		Object vo = lineRead.detail(lineId);
		return vo;
	}

	/**
	 * 列表
	 * @throws DzcxException 
	 */
	@Override
	public Object list(Object param) throws DzcxException {
		SearchLineBo bo = (SearchLineBo) param;
		Object result = lineRead.list(bo);
		return result;
	}


	/**
	 * 绑定站点列表
	 */
	public Object bindSiteList(Object param) throws DzcxException {
		DetailLineBo bo = (DetailLineBo) param;
		Long lineId = bo.getLineId();
		Object vo = lineRead.bindSiteList(lineId);
		return vo;
	}

	/**
	 * 绑定站点列表
	 */
	public Object queryBoardByLineId(Object param) throws DzcxException {
		DetailLineBo bo = (DetailLineBo) param;
		Long lineId = bo.getLineId();
		Object vo = lineRead.queryBoardByLineId(lineId);
		return vo;
	}

	/**
	 * 查询所有的line
	 * @return
	 * @throws DzcxException
	 */
	public Object queryAllList() throws DzcxException {
		Object vo = lineRead.queryAllList(新线招募类型.已开线路.key());
		return vo;
	}



}

